<?php
namespace app\index\controller;

use think\exception\ValidateException;
use app\model\Incomelog;
class IncomelogController extends Base
{
	public function index() {
        $uid = UID();
        $ptype = input('get.ptype');

        $where['weid'] = weid();
        $where['uid'] = $uid;
        $where['ptype'] = $ptype;

        $data = Incomelog::where($where)
                ->order('id desc')
                ->select()
				->toArray();

        foreach ($data as &$vo){
            $vo['pay_time'] = time_format($vo['pay_time']);
            $vo['create_time'] = time_format($vo['create_time']);
        }
		return $this->json(['data' => $data]);
    }
}
